-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use String instead of StaticString to be more inline with swift-log behaviour #118
Use String instead of StaticString to be more inline with swift-log behaviour #118
Conversation
Code Coverage Report
Generated by 🚫 Danger Swift against a6c1075 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution, @antranapp! I'm inclined to agree with this change, but I do wonder why swift-log
chose to go this route. Do you know more about that? Or a concrete example where we'd want to "override" a file or function reference?
Hi @BasThomas, I found this issue explaining why swift-log uses For my use case, I am wrapping The With this, I can automatically get all the log that I handle globally inside my app. |
Awesome, thanks for that! I wonder if we should treat this as a breaking change — if any packages depend on this one, and expect a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been requested before! #108 introduced it, but it's not a necessary requirement. I guess we can directly change it back to String
and just release as 4.0.0 release since it's indeed breaking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4.0 it is then 😊
I'll have a look at CI to make this PR green in the upcoming days! |
Congratulations! 🎉 This was released as part of Release 4.0.0 🚀 Generated by GitBuddy |
I am wrapping
DiagnosticsLogger
inside aLogHandler
from swift-log package so that I can use swift-log as the main logger for my app.But currently, Diagnostics is using StaticString for #file, #line, #function in the
log
methodswift-log is using
String
instead ofStaticString
for #file, #line, #functionI think, changing
StaticString
toString
would make it more interoperable with swift-log and provides more flexibility to integrate with other libraries as well.